<form id="form-modal" class="form-horizontal  form-modal" method="post" >
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">&times;</button>
                <h4 class="modal-title">邀请代理</h4>
            </div>
            <div class="modal-body">

                <div class="form-group">
                    <label class="col-sm-3 control-label">邀请方式：</label>
                    <div class="col-sm-8 ">
                        <label class="radio-inline">
                            <input type="radio" name="share_type" value="H5" checked /> H5
                        </label>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">邀请代理层级：</label>
                    <div class="col-sm-8 ">
                        <select name="proxy_id"  style="width: 130px;" data-toggle="select2" data-notsearch="true" data-chang="getQrcode">
                            {volist name="proxyLevel" id="vo"}
                            <option value="{$vo.proxy_id}">{$vo.proxy_name}</option>
                            {/volist}
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label"></label>
                    <div class="col-sm-9 ">
                        <img id="share_qrcode" style="width: 120px;height: 120px;" src="">
                        <div class="help-inline">
                            请把二维码发送给代理商扫码注册吧！您也可以复制以下地址：<span id="shareUrl"></span>
                        </div>
                    </div>
                </div>
            </div>

        </div>
    </div>
</form>
<script type="text/javascript">
    function getQrcode(){
        var arr = $('#form-modal').toJson();
        jq_ajax('{:url("getShareQrcode")}',arr,function (res) {
            if (res.code == 0){
                return _alert(res.msg);
            }
            $('#share_qrcode').attr('src',res.data.file);
            $('#shareUrl').html(res.data.shareUrl);
        });

    }
    setTimeout('getQrcode()',200)
</script>

